From 9a0c7e19001aa9e04e71eea9c56899b587e26ae2 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Thu, 24 Aug 2006 17:58:28 +0100 Subject: [PATCH] [LINUX] Remove hypercall permission checks from privcmd driver. This will allow the tools management to be revised independently of dom0 kernel interfaces. Currently tools cannot be 'smarter' than the kernel in terms of hypercalls they know about, because the kernel disallows access to any hypercalls it does not know about. Signed-off-by: Keir Fraser --- .../drivers/xen/privcmd/privcmd.c | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c index 390cf5c201..a1c4b6f68e 100644 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c @@ -35,9 +35,6 @@ static struct proc_dir_entry *privcmd_intf; static struct proc_dir_entry *capabilities_intf; -#define NR_HYPERCALLS 64 -static DECLARE_BITMAP(hypercall_permission_map, NR_HYPERCALLS); - static int privcmd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long data) { @@ -51,12 +48,6 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, if (copy_from_user(&hypercall, udata, sizeof(hypercall))) return -EFAULT; - /* Check hypercall number for validity. */ - if (hypercall.op >= NR_HYPERCALLS) - return -EINVAL; - if (!test_bit(hypercall.op, hypercall_permission_map)) - return -EINVAL; - #if defined(__i386__) __asm__ __volatile__ ( "pushl %%ebx; pushl %%ecx; pushl %%edx; " @@ -262,20 +253,6 @@ static int __init privcmd_init(void) if (!is_running_on_xen()) return -ENODEV; - /* Set of hypercalls that privileged applications may execute. */ - set_bit(__HYPERVISOR_acm_op, hypercall_permission_map); - set_bit(__HYPERVISOR_dom0_op, hypercall_permission_map); - set_bit(__HYPERVISOR_event_channel_op, hypercall_permission_map); - set_bit(__HYPERVISOR_memory_op, hypercall_permission_map); - set_bit(__HYPERVISOR_mmu_update, hypercall_permission_map); - set_bit(__HYPERVISOR_mmuext_op, hypercall_permission_map); - set_bit(__HYPERVISOR_xen_version, hypercall_permission_map); - set_bit(__HYPERVISOR_sched_op, hypercall_permission_map); - set_bit(__HYPERVISOR_sched_op_compat, hypercall_permission_map); - set_bit(__HYPERVISOR_event_channel_op_compat, - hypercall_permission_map); - set_bit(__HYPERVISOR_hvm_op, hypercall_permission_map); - privcmd_intf = create_xen_proc_entry("privcmd", 0400); if (privcmd_intf != NULL) privcmd_intf->proc_fops = &privcmd_file_ops; -- 2.30.2